<!DOCTYPE html>
<html lang="en">

<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
table th{

    background-color: rgb(209, 99, 179) ;
    width: 170px ;
    height: 50px ;
    font-size: 20px;
}
table td a{
    text-decoration: none ;
}
table th,table td{
    text-align: center ;
}
    </style>
</head>

<body>
{% extends "motherboard.html"%}
  {% block shop %}
<div class="panel panel-default">
        <div id="collapseTwo" class="panel-collapse collapse">
			<div class="panel-body">
                {% load static %}
				<img width="1200px" height="500px" src="{% static '/images/num.png' %}" alt="" >
			</div>
		</div>
		<div class="panel-heading">
    <table border="1" class="table table-striped" class="table table-condensed">
        <tr>
        <th>款式编码</th>
        <th>分类</th>
        <th style="font-size:15px">   <form action="" method="POST">
            {% csrf_token %}
     <button type="submit" value="上标" name="paixu">
        {% load static %}
      <img src="{% static '/images/上标.png' %}" alt=""  width="20px" height="20px">
    </button>  库存
    <button type="submit" value="下标" name="paixu">
        {% load static %}
        <img src="{% static '/images/下标.png' %}" alt="" width="20px" height="20px">
    </button>
    </form></th>
        <th style="font-size:15px">   <form action="" method="POST">
            {% csrf_token %}
     <button type="submit" value="上上标" name="paixu">
        {% load static %}
      <img src="{% static '/images/上标.png' %}" alt=""  width="20px" height="20px">
    </button>  近15天销量
    <button type="submit" value="下下标" name="paixu">
        {% load static %}
        <img src="{% static '/images/下标.png' %}" alt="" width="20px" height="20px">
    </button>
    </form></th>
        <th>？无库存</th>
        <th>生产周期</th>
        </tr>
          {% for line in page_obj.object_list %}
        <tr>
            <td>{{line.number}}</td>
            <td>{{line.cation}}</td>
            <td>{{line.stock}}</td>
            <td>{{line.sales}}</td>
            <td>{{line.tory}}</td>
            <td>{{line.production}}</td>
        </tr>
        {% endfor %}
    </table>
</div>
</div>
<ul class="pagination">
	<li><a href='?page=1&choice={{choice}}&fenlei={{fenlei}}&paixu={{paixu}}'>首页</a></li>
	{% if page_obj.has_previous %}
            <li><a href="?page={{ page_obj.previous_page_number }}&choice={{choice}}&fenlei={{fenlei}}&paixu={{paixu}}" >上一页</a></li>
            {# 如果上一页没有数据了，那么不让做任何操作 #}
        {% else %}
        {% endif %}

    {% if data.first %}
                    <li><a href="/index1/stock/?page=1&choice={{choice}}&fenlei={{fenlei}}&paixu={{paixu}}">1</a></li>
                {% endif %}
                {% if data.left %}
                    {% if data.left_s %}
                        <li><a href="#">...</a></li>
                    {% endif %}
                    {% for i in data.left %}
                        <li><a href="/index1/stock/?page={{ i }}&choice={{choice}}&fenlei={{fenlei}}&paixu={{paixu}}">{{ i }}</a></li>
                    {% endfor %}
                {% endif %}
                <li><a href="#"> {{ page_num }}</a></li>
                {% if data.right %}
                    {% for i in data.right %}
                        <li><a href="/index1/stock/?page={{ i }}&choice={{choice}}&fenlei={{fenlei}}&paixu={{paixu}}">{{ i }}</a></li>
                    {% endfor %}
                    {% if data.right_s %}
                        <li><a href="#">...</a></li>
                    {% endif %}
                {% endif %}
                {% if data.last %}
                    <li ><a href="/index1/stock/?page={{ paginator.num_pages }}&choice={{choice}}&fenlei={{fenlei}}&paixu={{paixu}}">{{ paginator.num_pages }}</a>
                    </li>
                {% endif %}

	{# 如果当前页还有下一页，那么让其可以点击进入下一页 #}
        {% if page_obj.has_next %}
            <li><a href="/index1/stock/?page={{ page_obj.next_page_number }}&choice={{choice}}&fenlei={{fenlei}}&paixu={{paixu}}" >下一页</a></li>
        {% endif %}
	{# 跳转到尾页，让page参数直接等于总页数 #}
        <li><a href='/index1/stock/?page={{ paginator.num_pages }}&choice={{choice}}&fenlei={{fenlei}}&paixu={{paixu}}'>尾页</a></li>
</ul>
        {% endblock %}
</body>
</html>